package gspushmq.v1.save.log;

import java.util.concurrent.LinkedBlockingQueue;

import ggframework.util.GGLogger;

public enum LogQueue {

	queue;
	
	private LinkedBlockingQueue<LogBean> records = new LinkedBlockingQueue<LogBean>();
	
	
	public void add (LogBean log){
		if(records.size() >= 2000){
			GGLogger.info(LogQueue.class, "队列：" + this.name() + "    " + records.size());
		}
		records.offer(log);
	}
	
    public LogBean get() {
        return records.poll();
    }
    
    public int getSize() {
        return records.size();
    }
    
    public boolean isEmpty(){
    	return records.isEmpty();
    }
}
